import Vue from 'vue'
import App from './App.vue'
import router from './router'
import Vant from 'vant';
import 'vant/lib/index.css';
import "./assets/css/public.css"
import "./assets/css/login.css"
import "./assets/css/login_two.css"
import "./assets/css/configuration.css"
import axios from "axios";
import './plugins/element.js'


import  AddressEdit  from 'vant';

Vue.use(AddressEdit);


Vue.use(Vant);

//设置axios基础路径
axios.defaults.baseURL="http://192.168.1.18:81"


Vue.config.productionTip = false

/*axios.defaults.headers.post['Content-Type'] = 'application/json'*/

    //设置axios得请求拦截器---在请求头上添加token
axios.interceptors.request.use(config=>{
  //从sessionStorage获取token值
  var token = sessionStorage.getItem("token");
  if(token){ //token不为空则为真
    //请求头中会携带token
    config.headers.token=token;
  }
  return config;
})

Vue.prototype.$http=axios

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
